package cate.common.table.activity.dailygift;

import cate.common.annotation.SplitParse;
import cate.common.util.SplitParser;
import cate.common.util.random.RWItem;
import cate.common.util.random.RWList;

import java.util.List;

public class RandomNumItems extends RWList<RandomNumItems.Item> {

    public void parse(String config) {
        List<RandomNumItems.Item> l = SplitParser.parse(RandomNumItems.Item.class, config);
        this.setup(l);
    }

    public static class Item implements RWItem {
        @SplitParse(order = 0, note = "数量")
        public int num;

        @SplitParse(order = 1, note = "权重", defaultValue = "1.0")
        public double weight;

        @Override
        public double getWeight() {
            return weight;
        }
    }
}
